home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / mutt / me2s_pl7.zoo / mu_edit2 / ed / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-05  |  1.3 KB  |  56 lines

  1. static char rcsid[] = "$Id: main.c,v 1.1 1992/09/14 13:02:14 mike Exp $";
  2.  
  3. /* $Log: main.c,v $
  4.  * Revision 1.1  1992/09/14  13:02:14  mike
  5.  * Initial revision
  6.  *
  7.  */
  8.  
  9. #include <const.h>
  10. #include "ed.h"
  11. #include "led.h"
  12.  
  13. extern char *Ltext;        /* the text the user input */
  14. extern int Lerrorno;        /* LEDs error number */
  15.  
  16. extern Lmacs();
  17.  
  18. /* ******************************************************************** */
  19. /* ************************* TEST ************************************* */
  20. /* ******************************************************************** */
  21.  
  22. callback(kc,fcn) KeyCode kc; int fcn;
  23. {
  24.   switch (fcn)
  25.   {
  26.     case 1: return Ldo_fcn(LF_INSERT_KEYCODE,'a',LF_STOP);
  27.     case 2: return Ldo_fcn(LF_INSERT_STRING,"<Callback 2>",LF_STOP);
  28.     case 3:
  29.       Led("(Recursing) ","",(pfi)NULL);
  30.       break;
  31.   }
  32.   return LF_NOOP;
  33. }
  34.  
  35. extern int Lncol, t_ncol;
  36. main(argc,argv) int argc; char **argv;
  37. {
  38.   char buf[80], *spoof();
  39.   int n;
  40.  
  41.   t_open();
  42.   init_Led(); Lmacskeys();
  43.  
  44.   Ldo_fcn(LF_BINDKEY,
  45.     LF_CALLBACK,1,'A', LF_CALLBACK,2,'~', LF_CALLBACK,3,META|'R',
  46.     LF_STOP,LF_STOP);
  47.   for (n = 1; 1; n++)
  48.   {
  49.     sprintf(buf,"Led[%d]: ",n);
  50.     if (LF_ABORT == Led(buf,"",callback)) break;
  51.     printf("\nYou typed: \"%s\"\n",Ltext);
  52.   }
  53.   t_close();
  54.   printf("\nAll done.\n");
  55. }
  56.